package com.xiaohao;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.bookmanger.entity.Order;
import org.junit.Test;
import org.springframework.stereotype.Component;

import java.util.Calendar;
import java.util.Date;

/**
 * @author huangfuhao
 * @Date 2024/11/10
 */
@Component
class ScheduledTask {

    @Test
    public void scanOrders(){
        //获取当前时间
        Calendar calendar = Calendar.getInstance();

        //清楚毫秒部分
        calendar.set(Calendar.MILLISECOND, 0);
        //获取不打哎毫秒的Date对象
        Date date = calendar.getTime();
        //  获取对应时间戳
        Long time = date.getTime();

        LambdaQueryWrapper<Order> orderWrapper = new LambdaQueryWrapper<>();
        orderWrapper.lt(Order::getEndTime,time);


        //将查到的订单借阅状态改为“过期未归还（2）”


        //同时将过期未归还的学生借阅状态改为“禁止借阅”
    }
}